package com.mo.common;

import lombok.Builder;
import lombok.Data;

@Data
@Builder
public class Result {
    Integer code;
    Boolean success;
    String message;
    Object data;

    public static Result success(String message, Object data) {
        return Result.builder()
                .code(200)
                .success(true)
                .message(message)
                .data(data)
                .build();
    }

    public static Result error(String message, Integer code) {
        return Result.builder()
                .code(code)
                .success(false)
                .message(message)
                .build();
    }
}
